<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<include file="public:meta" />
		<link href="../public/css/company/common.css" rel="stylesheet" type="text/css" />
		<link href="../public/css/company/company_resumes.css" rel="stylesheet" type="text/css" />
		<link href="../public/css/company/company_ajax_dialog.css" rel="stylesheet" type="text/css" />
		<script src="../public/js/company/jquery.common.js" type="text/javascript" language="javascript"></script>
	</head>
	<body>
		<include file="index_header" />
		<div class="user_main">
			<div class="mleft">
				<include file="left_resumes" /> 
			</div>
			<div class="mright">
				<div class="user_pagetitle">
					<div class="pat_l">简历</div>
					<!--<div class="pat_r">系统保留三个月的记录，共<strong> {$apply_list['count']} </strong>条</div>-->
					<div class="clear"></div>
				</div>
				
				<div class="resume_receive_th">
					
    				<div class="th1">姓名</div>
    				<div class="th3">基本信息</div>
    				<div class="th4">应聘职位</div>
    				<div class="th5">
    					<div class="input_90_30_div J_hoverinput J_dropdown J_listitme_parent">
							<span class="J_listitme_text">
								<if condition="$Think.get.settr eq 0">
									应聘时间
								<else />
									{$Think.get.settr}天内
								</if>
							</span>
							<div class="dropdowbox11 J_dropdown_menu">
					            <div class="dropdow_inner11">
					                <ul class="nav_box">
					                	<li><a class="J_listitme" href="{:P(array('settr'=>0))}" >不限时间</a></li>
					                	<li><a class="J_listitme" href="{:P(array('settr'=>3))}" >3天内</a></li>
					                	<li><a class="J_listitme" href="{:P(array('settr'=>7))}" >7天内</a></li>
					                	<li><a class="J_listitme" href="{:P(array('settr'=>15))}" >15天内</a></li>
					                	<li><a class="J_listitme" href="{:P(array('settr'=>30))}" >30天内</a></li>
					                </ul>
					            </div>
					        </div>
						</div>
    				</div>
    				<div class="clear"></div>
    			</div>
				<form id="form1" action="{:U('del_jobs_apply')}" method="post" class="J_allListBox">
				<notempty name="apply_list['list']">
				<volist name="apply_list['list']" id="vo">
				<div class="resume_receive" did="{$vo['did']}">
					<if condition="$vo['fullname']">
						<div class="td1 link_black substring"><a target="_blank" href="{:url_rewrite('QS_resumeshow',array('id'=>$vo['resume_id'],'jobs_id'=>$vo['jobs_id'],'from_apply'=>1))}">{$vo['fullname']}</a></div>
	    				<div class="td3">{$vo['age']}岁/{$vo['sex_cn']}/{$vo['education_cn']}/{$vo['experience_cn']}</div>
	    				<div class="td4 link_blue substring"><a target="_blank" href="{$vo.jobs_url}">{$vo['jobs_name_']}</a></div>
	    				<div class="td5">{:fdate($vo['apply_addtime'])}</div>
	    				
    				<else />
						<div class="td1 empty">
							<div class="input">
								<input name="y_id[]" class="J_allList" type="checkbox" value="{$vo['did']}"> &nbsp;该简历不存在或已被删除
							</div>
	    				</div>
	    				<div class="td6 link_blue"><a href="javascript:;" url="{:U('company/del_jobs_apply',array('y_id'=>$vo['did']))}" class="clink J_del_resume">删除</a></div>
    				</if>
    				<div class="clear"></div>					
				</div>
				</volist>
				<div class="resume_but">
		 			<div class="clear"></div>
	    		</div>
				<div class="qspage">{$apply_list['page']}</div>
				<else />
					<if condition="$hasget">
					<div class="res_empty">
						抱歉，没有找到符合您条件的简历，建议您修改筛选条件后重试
					</div>
					<else />
					<div class="res_empty link_blue">
						收到的简历不够多？不如主动出击找人才！<br />
						海量优质简历任您选，快速招人不再难。立即 <a href="{:url_rewrite('QS_resume')}" target="_blank">搜人才</a>
					</div>
					</if>
				</notempty>
				</form>
			</div>
		</div>
		<include file="index_footer" />
		<script type="text/javascript" src="../public/js/laydate/laydate.js"></script>
		<script type="text/javascript" src="../public/js/jquery.allselected.js"></script>
		<script type="text/javascript">
			$(document).ready(function(){
				$(".label_resume").click(function(){
					var url = $(this).attr('href');
					$.getJSON(url,function(result){
						if(result.status==1){
							if(result.data){
								disapperTooltip("goldremind", '处理3天内收到的简历增加'+result.data+'{:C('qscms_points_byname')}<span class="point">+'+result.data+'</span>');
							}else{
								disapperTooltip('success',result.msg);
							}
							setTimeout(function () {
		                        window.location.reload();
		                    }, 2000);
						}else{
							disapperTooltip('remind', result.msg);
						}
					});
					return false;
				});
				$(".jump").click(function(){
					location.href=$(this).attr('url');
				});
				$("#save_as_doc_word").click(function(){
					var $checkArr = $('.J_allList:checked');
					if($checkArr.length<=0){
						disapperTooltip('remind', '请选择简历');
						return false;
					}
					var valArr = new Array();
					$.each($checkArr, function(){
						if($(this).attr('resume_id')){
							valArr.push($(this).attr('resume_id'));
						}
					});
					if(valArr.length == 0){
						disapperTooltip('remind','选择的简历不存在或已被删除！');
						return false;
					}
					$("#form1").attr('action',"{:U('resume_doc_for_apply')}");
					$("#form1").attr('target',"_blank");
					$("#form1").submit();
				});
				$(".J_del_resume").click(function () {
		            var url = $(this).attr('url');
		            var qsDialog = $(this).dialog({
				        title: '删除收到的简历',
		                loading: true,
		                border: false,
		                footer: false
		            });
		            $.getJSON(url, function (result) {
		                if (result.status == 1) {
		                	qsDialog.hide();
		                	var qsDialogSon = $(this).dialog({
				                title: '删除收到的简历',
				                content: result.data.html,
				                border: false,
				                yes: function () {
				                    window.location.href = url;
				                }
				            });
		                } else {
		                	qsDialog.hide();
		                    disapperTooltip('remind', result.msg);
		                }
		            });
		        });
				// 批量删除
		        $('#deleteall').click(function () {
		            var listCheckedArray = $('.J_allListBox .J_allList:checked');
		            if (listCheckedArray.length) {
		            	var url = "{:U('del_jobs_apply')}";
		                var qsDialog = $(this).dialog({
					        title: '删除收到的简历',
			                loading: true,
			                border: false,
			                footer: false
			            });
		                $.getJSON(url, function (result) {
		                    if (result.status == 1) {
		                    	qsDialog.hide();
				                var qsDialogSon = $(this).dialog({
				                    title: '删除收到的简历',
				                    content: result.data.html,
				                    border: false,
				                    yes: function () {
				                    	$("#form1").attr('action',"{:U('del_jobs_apply')}");
		                				$("#form1").attr('target',"_self");
				                        $("#form1").submit();
				                    }
				                });
		                    } else {
		                    	qsDialog.hide();
		                        disapperTooltip('remind', result.msg);
		                    }
		                });
		            } else {
		                disapperTooltip("remind", "请选择要删除的简历");
		            }
		        });
				$('.J_interview').click(function(){
					var qsDialog = $(this).dialog({
		        		title: '邀请面试',
						loading: true,
						showFooter: false,
						yes: function() {
							var notesVal = $.trim($('input[name="notes"]').val());
							if (notesVal.length > 40) {
								$('input[name="notes"]').focus();
								disapperTooltip('remind','最多输入40个字');
								return false;
							}
							$('.J_btnyes').val('发送中...');
							$.post("{:U('company/jobs_interview_add')}",$('#J_interviewWrap').serialize(),function(result){
								if(result.status == 1){
									disapperTooltip('success',result.msg);
									setTimeout(function () {
										window.location.reload();
									}, 2000);
								} else {
									$('.J_btnyes').val('确定');
									disapperTooltip('remind',result.msg);
								}
							},'json');
						}
					});
					qsDialog.setCloseDialog(false);
					var resume_id = $(this).attr('resume_id');
					$.getJSON("{:U('company/jobs_interview_add')}",{id:resume_id},function(result){
			    		if(result.status == 1){
			    			qsDialog.setContent(result.data);
        					qsDialog.showFooter(true);
							laydate({
								elem: '#date',
                        		min: laydate.now()
							})
			    		}else{
			    			qsDialog.setContent('<div class="confirm">' + result.msg + '</div>');
			    		}
			    	});
				});
				$("#send_to_email").click(function(){
					var $checkArr = $('.J_allList:checked');
					if($checkArr.length<=0){
						disapperTooltip('remind', '请选择简历');
						return false;
					}
					var valArr = new Array();
					$.each($checkArr, function(){
						if($(this).attr('resume_id')){
							valArr.push($(this).attr('resume_id'));
						}
					});
					if(valArr.length == 0){
						disapperTooltip('remind','选择的简历不存在或已被删除！');
						return false;
					}
					var qsDialog = $(this).dialog({
		                title: '转发到邮箱',
		                loading: true,
		                border: false,
		                footer: false
		            });
					
					$.getJSON("{:U('company/send_to_email')}",{resume_id:valArr},function(result){
						if(result.status==1){
							qsDialog.hide();
							var qsDialogSon = $(this).dialog({
				                title: '转发到邮箱',
				                content: result.data,
				                btns: ['发送', '取消'],
				                border: false,
				                yes: function () {
				                	qsDialogSon.setCloseDialog(false);
				                	var email = $("#send_to_email_val").val();
				                	var regularEmail = /^[_\.0-9a-zA-Z-]+[_0-9a-zA-Z-]@([0-9a-zA-Z][0-9a-zA-Z-]+\.)+[a-zA-Z]{2,3}$/;
				                	if(email==''){
				                		disapperTooltip('remind','请填写邮箱');
										return false;
				                	}
				                	if (email != "" && !regularEmail.test(email) || email.split("@")[0].length > 20) {
										disapperTooltip("remind", "邮箱格式不正确");
										return false;
									}
				                    $('.J_btnyes').val('发送中...').prop('disabled', !0);
				                    $.post("{:U('company/send_to_email')}",{email:email,resume_id:valArr},function(result){
				                    	if(result.status==1){
				                    		qsDialogSon.hide();
				                    		disapperTooltip('success',result.msg);
				                    	} else {
				                    		$('.J_btnyes').val('发送').prop('disabled', 0);
				                    		disapperTooltip('remind',result.msg);
				                    	}
				                    },'json');
				                }
				            });
						} else {
							qsDialog.hide();
							disapperTooltip('remind',result.msg);
						}
					});
				});
			});
		</script>
	</body>
</html>